package com.go8.sso.token;

import java.util.HashMap;
import java.util.Map;

import org.springframework.stereotype.Component;

//@Component
public class LocalTokenCache implements TokenCache{
	private Map<String,Object> tokens;
	
	public LocalTokenCache() {
		this.tokens = new HashMap<>();
	}

	public Map<String, Object> getTokens() {
		return tokens;
	}

	public void setTokens(Map<String, Object> tokens) {
		this.tokens = tokens;
	}


	@Override
	public Object getByToken(String token) {
		return this.tokens.get(token);
	}

	@Override
	public void setByToken(String token, Object object) {
		this.tokens.put(token, object);
	}

	@Override
	public void delByToken(String token) {
		this.tokens.remove(token);
	}
}
